/*
 * Created 14-mar-2005.
 */
package moon.metrics.concretemetrics;

import moon.core.NamedObject;
import moon.core.classdef.MethDec;
import moon.metrics.core.Measure;
import moon.metrics.core.MethodMetric;
/**
 * Lines Of Code (aproximately)
 * @author Estrella Resa Camarero and Laura Moneo Sanz
 * @version 1.0
 * @since JavaMOON 1.3
 * @see MOONMetric
 */
public class LOC extends MethodMetric {

	/**
	 * Constructs a LOC metric.
	 *
	 * @param name         name
	 * @param description  description
	 * @param valueMin     minimum value
	 * @param valueMax     maximum value
	 */
	 
	public LOC(String name, String description, float valueMin, float valueMax) {
		super(name, description, valueMin, valueMax);
	}

	/**
	 * Constructs a LOC metric.
	 * 
	 * @param name name
	 * @param description description
	 * @param author author
	 * @param year year
	 * @param valueMin minimum value
	 * @param valueMax maximum value
	 */
	public LOC(String name, String description, String author, int year,
			float valueMin, float valueMax) {
		super(name, description, author, year, valueMin, valueMax);
	}

	/**
	 * Calculates the number of lines.
	 * 
	 * @param namedObject object to measure
	 * @return  measure
	 */
	public Measure run (NamedObject namedObject) {
		
		
		MethDec md = (MethDec) namedObject;
		

		int value = lines (md);	
		Measure m = new Measure((float) value, md, this);
		return m;

	}
	
	/**
	 * Solution to count the number of lines of a method.
	 *  
	 * @param md method
	 * @return number of lines
	 */
	private int lines(MethDec md){
		// TODO		
		assert false;
		return 0;
	}
}